home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Applications / TimGA 1.2.1 / .h / CGraphGAApp.h < prev    next >
Encoding:
Text File  |  1997-07-16  |  2.2 KB  |  81 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    CGraphGAApp.h        ©1995-97 Timo Eloranta            All rights reserved.
  3. // ===========================================================================
  4. //    The application class - subclassed from LDocApplication.
  5.  
  6. #pragma once
  7.  
  8. #include <LDocApplication.h>
  9. #include <LGADialogBox.h>        // SLGADialogResponse
  10.  
  11. #include "MyStructs.h"            // SSelection, STermination,
  12.                                 // SEvaluation, SGeneral
  13. class    CGraphWindow;
  14. class    CGraphGADoc;
  15.  
  16. class    CGraphGAApp : public LDocApplication {
  17. private:
  18.  
  19.     CGraphWindow    *mWindow;
  20.     CGraphGADoc        *mDoc;
  21.     
  22.     Boolean            mDocShouldGetShot;
  23.  
  24.     void            InitForNoGraph();
  25.     void            RemoveDoc();
  26.     void            SetDefaults();
  27.     void            RegisterClasses();
  28.     Boolean            AskNewGraphSize();
  29.  
  30.     void            SetProbsFromDialog(        SLGADialogResponse *inResponse );
  31.     void            SetTerFromDialog(        SLGADialogResponse *inResponse );
  32.     void            SetEvalFromDialog(        SLGADialogResponse *inResponse );
  33.     
  34.     virtual void    EventSuspend    (const EventRecord &inMacEvent);
  35.     virtual void    EventResume        (const EventRecord &inMacEvent);
  36.  
  37. protected:
  38.     virtual void    Initialize();
  39.  
  40. public:
  41.                     CGraphGAApp();
  42.     virtual         ~CGraphGAApp();
  43.         
  44.         // this overriding function performs application functions
  45.         
  46.     virtual Boolean        ObeyCommand( CommandT inCommand, void* ioParam = nil);    
  47.     
  48.         // this overriding function returns the status of menu items
  49.         
  50.     virtual void        FindCommandStatus(    CommandT inCommand,
  51.                             Boolean &outEnabled, Boolean &outUsesMark,
  52.                             Char16 &outMark, Str255 outName);
  53.  
  54.     virtual void            OpenDocument( FSSpec *inMacFSSpec );
  55.     virtual LModelObject*    MakeNewDocument();
  56.     virtual void            ChooseDocument();
  57.     
  58.     virtual void            ShowAboutBox();
  59.  
  60.     Int32            mNewGraphNodes,
  61.                     mNewGraphEdges,
  62.                     mCrossoverProb,
  63.                     mMutationProb;
  64.     SSelection        mSelection;
  65.     STermination    mTermination;
  66.     SEvaluation        mEvaluation;
  67.     SGeneral        mGeneral;
  68.     
  69.     Int16    GetGridSize() {    return mGeneral.sizeGrid;    };
  70.  
  71.     void    SetSelFromDialog(        SLGADialogResponse *inResponse );
  72.     void    SetGeneralFromDialog(    SLGADialogResponse *inResponse,
  73.                                     Int16 inNodes );
  74.                                   
  75.     void    SetDocToBeShot( Boolean inShoot )
  76.                         { mDocShouldGetShot = inShoot; };
  77.                                   
  78.     CGraphWindow *    GetGraphWindow()
  79.                         {    return mWindow; };
  80. };
  81.